/**倒计时开始*********/
var cdCallback = function(obj) {
}

function getSeverTime(obj,endTime,nowTime,callback) {
 	nowTime=nowTime ? nowTime : getCookie('bg_time');
	//距离结束倒计时
	if( endTime > nowTime  ){	
		SysSecond = parseInt(endTime - nowTime); 
		SetRemainTime(SysSecond,obj,callback);
	}
}
//倒计时运算
function SetRemainTime(SysSecond,obj,callback){ 
	obj = obj ? $(obj) : $('#remainTime');
	if( SysSecond <= 0 ){
		callback(obj);
		return true;		
	}

	SysSecond  = parseInt(SysSecond)-1;
	var _date  = parseInt(SysSecond / 3600 / 24);
	var hour   = parseInt((SysSecond / 3600) % 24); 
	var minite = Math.floor(((SysSecond /60)) % 60); 
	var second = Math.floor(SysSecond % 60); 

	if( second < 10 ) second = '0'+second;
	if( minite < 10 ) minite = '0'+minite;
	if( hour < 10 ) hour = '0'+hour;
	//if(microsecond<10) microsecond='0'+microsecond;
	//microsecond = microsecond.toString().slice(0,2)
	obj.html("<span>"+_date+"</span>天<span>"+hour+"</span>时<span>"+minite+"</span>分<span>"+second+"</span>秒");
 	setTimeout(function(){SetRemainTime(SysSecond,obj,callback)}, 1000);
}